const Koa = require('koa')
const static = require('koa-static')
const path = require('path')
const historyApiFallback = require('koa2-connect-history-api-fallback');
const app = new Koa()
const staticPath = './dist'
app.use(historyApiFallback({ whiteList: ['/api'] }));
app.use(static(
  path.join(__dirname, staticPath)
))
app.use(async(ctx) => {
  ctx.body = 'hello world'
})
app.listen(3000, () => {
  console.log('server is starting at port 3000')
})